package gcontent.channel;

import gcontent.channel.error.ChannelEx;
import gcontent.entities.Content;
import gcontent.entities.Site;
import gcontent.entities.content.error.ContentEx;
import gcontent.launch.SpiderThread;
import gcontent.record.db.RecordDB;
import gcontent.record.error.RecordEx;
import gcontent.rsrc.ThreadResources;

public class Channel {
	
	/* database access */
	protected RecordDB record;
	
	protected SpiderThread spider;

	/* last content get it */
	protected Content cur_content = null;

	/* get protocol name */
	public String getProtocol() { return null; };
	
	/* get content */
	public Content getContent(Site site) throws ChannelEx { return null; } ;
	
	/* save last content get it */
	public void saveContent() throws RecordEx, ContentEx { };
	
	public Channel()
	{
		this.spider = (SpiderThread)ThreadResources.getResource(ThreadResources.RSRC.SPIDER);
		if(this.spider != null)
			this.record = (RecordDB)this.spider.getRecord();	
	}
}
